<?php
session_start();
require_once('auth.php');
?>
<html>
<head>
<link href="loginmodule.css" rel="stylesheet" type="text/css" />

  <script language=javascript>
//This function is for making a pop up window when you press "Buy Ticket Online"

function popup(mylink, windowname)
{
if (! window.focus)return true;
var href;
if (typeof(mylink) == 'string')
   href=mylink;
else
   href=mylink.href;
window.open(href, windowname, 'width=450,height=350,scrollbars=yes');
return false;
}

</script>
</head>
<style type="text/css">
div{
position:fixed;
top: 10px;
right:10px;
}
#form{
position:fixed;
top:70px;
left: 200px;
}

</style>
<body>
<?php


if (isset ($_SESSION['ERRMSG_ARR']) && is_array($_SESSION['ERRMSG_ARR']) && count($_SESSION['ERRMSG_ARR']) > 0) {

	echo '<ul class="err">';

	foreach ($_SESSION['ERRMSG_ARR'] as $msg) {

		echo '<li>', $msg, '</li>';

	}

	echo '</ul>';

	unset ($_SESSION['ERRMSG_ARR']);

}
?>
<?php
include_once ("common.php");
printHeader();
?>

<h1>Please Leave Feedback</h1>
<div>


<form name=form method=post action="search-feedback.php" >
<input type=text name=moviefeedback size="12"><input type=submit value="search movie"></td>
</form>
</div>

</html>

<?php
require_once ('config.php');

$connect = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD) or die('Could not connect: ' . mysql_error());

mysql_select_db(DB_DATABASE, $connect);

echo "<form name=\"form1\" method=post action=\"feedback.php\">
<table id=\"form\">
<tr><td><a>Movie name: </a></td><td><select name=\"moviename\" size=\"1\"style=\"background-color:#FFFFD7\">
";

$sql = "select ID, name from movielist";

$result = mysql_query($sql, $connect);
while ($row = mysql_fetch_array($result)) {
	//print movie name into drop down menu.
	if (array_key_exists('name', $row)) {
		echo "<option selected> $row[name] </option>";
	}
}
echo "</select></td></tr>";
?>

<html>
<tr><td><a>Feedback</a></td><td><TEXTAREA name=feedback rows=5 cols=40> </TEXTAREA></td></tr>
<tr><td><a>Userrating</a></td>
<td><input type="radio" name="rating" value="1">1
<input type="radio" name="rating" value="2">2
<input type="radio" name="rating" value="3" checked>3
<input type="radio" name="rating" value="4">4
<input type="radio" name="rating" value="5">5</td>
</tr>
<tr height="30"/>
<tr><td/><td><input type="submit" value="Submit" /></td></tr>
</table>
</form>

</body>
</html>